# This is the makefile for lab 18, you must add/change targets 
# and dependencies as necessary
# some of it is done for you

# These Make variable declarations are correct, use them to make it easier 
#  on yourself.  This is just textual replacement, $(CC) will be replaced
#  with gcc, for example.

# Kyle Kelly
# CS2110-B2
CC=gcc
WFLAGS=-std=c99 -pedantic -Wall
OFLAGS=-O2
CFLAGS=$(OFLAGS) $(WFLAGS)
INCLUDES=defs.h ops.h io.h
OBJS=main.o ops.o io.o
PROGNAME=calculator

# don't assume these targets are done
test-output: $(PROGNAME) test-input.in
	@./$(PROGNAME) test-input.in > "test-output.out"
	@echo "It worked, lawl"

$(PROGNAME): $(OBJS)
	@$(CC)  $(OFLAGS) $(WFLAGS) -o $(PROGNAME) $(OBJS) 

# these targets are not completely correct, look at it carefully!
ops.o: ops.c ops.h defs.h
	@$(CC) -c $(CFLAGS) ops.c 

main.o: main.c io.h ops.h
	@$(CC) -c $(CFLAGS) main.c 

# This is correct!
# Use this often to clean up failed attempts to build
# Type "make clean" to use it!
clean: 
	@rm -rf main.o ops.o  $(PROGNAME) test-output
	@echo "Clean clean clean clean clean clean clean clean clean clean"
